package ttOrder.dao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import ttOrder.vo.OrderVO;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"file:WebContent/WEB-INF/viewspace-servlet.xml"})
@Transactional
public class Test1 {
	@Autowired
	private OrderDAOImpl orderDAOImpl;
	@Test
	public	void	getOrder()throws Exception{
		OrderVO ordervo=orderDAOImpl.getOrder(1);
		System.out.println(ordervo.getFoodId());
	}
	
	@Test
	public	void	create()throws Exception{
		OrderVO ordervo=new OrderVO();
		ordervo.setId(5);
		ordervo.setOrderId(2);
		ordervo.setFoodId(1);
		ordervo.setFoodcount(4);
		orderDAOImpl.create(ordervo);
	}
	
}
